package fcrpt

class PartInspectionMsgController {
    def dynamicQueryService
    def partInspectionMsg(){

        def pageCurrent = params.pageCurrent ? Integer.parseInt(params.pageCurrent) : 1
        def pageSize = params.pageSize ? Integer.parseInt(params.pageSize) : 10
        params.startno = (pageSize * (pageCurrent - 1)) + 1
        params.endno = pageSize * pageCurrent
        def pageSizeList = [10,20,50,100]
        def tableHeadList=[]
        def partInspectionMsg=[]
        def totalCount =0
        if(params.EXPORT_CONTENT_NAME=='Excel') {
            params.SYS_QUERY_NAME = 'partInspectionMsg'
            partInspectionMsg = dynamicQueryService.queryForList(params)
            tableHeadList = []
            if (partInspectionMsg.size() > 0) {
                tableHeadList = partInspectionMsg[0].keySet()
            }
            params.SYS_QUERY_NAME = 'partInspectionMsgCount'
            totalCount = dynamicQueryService.queryForList(params)[0].TOTALCOUNT
        }
        [tableHeadList:tableHeadList,
         pageSizeList:pageSizeList,pageSize:pageSize,
         startno:params.startno?:'',endno:params.endno?:'',partPicNum:params.partPicNum?:'',
         partDesc:params.partDesc?:'',step:params.step?:'',partInspectionMsg:partInspectionMsg,totalCount:totalCount,

         checkinBy:params.checkinBy?:'',part:params.part?:'',lotId:params.lotId?:'',fire:params.fire?:'',cate:params.cate?:'',finalUser:params.finalUser?:'',
         gflb:params.gflb?:'',checkoutBy:params.checkoutBy?:'',startTime:params.startTime?:'',endTime:params.endTime?:'',
         start:params.start?:'', end:params.end?:'',
         checkoutByName:params.checkoutByName?:'',checkinByName:params.checkinByName?:''

        ]
    }
}
